FROM openanolis/anolisos:8.6

LABEL maintainer="OpenAnolis Cloud Native SIG"

RUN yum -y update \
    && yum -y install httpd \
    && yum clean all

ENV HTTPD_PREFIX /usr/local/apache2

ENV HTTPD_VERSION 2.4.37

ENV HTTPD_PATCHES=""

RUN set -eux; \
    sed -ri \
        -e 's!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g' \
	-e 's!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g' \
	-e 's!^(\s*TransferLog)\s+\S+!\1 /proc/self/fd/1!g' \
        "/etc/httpd/conf/httpd.conf" \
    ; \
    httpd -v

STOPSIGNAL SIGWINCH

COPY httpd-foreground /usr/local/bin/

EXPOSE 80

CMD ["httpd-foreground"]

